package com.gwt.client.event;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

public class RequestJsonEvent extends GwtEvent<RequestJsonEvent.Handler>{
	public static final Type<Handler> TYPE = new Type<Handler>();
	
	public interface Handler extends EventHandler{
		void handleResult(JavaScriptObject obj);
	}
	
	private JavaScriptObject jso;
	
	public RequestJsonEvent(JavaScriptObject jso){
		this.jso = jso;
	}

	@Override
	public Type<Handler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(Handler handler) {
		handler.handleResult(jso);
	}
}
